<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="/jsp/common/common.jsp" %>
<style>
    pre {outline: 1px solid #ccc; padding: 5px; margin: 5px; overflow: auto;}
    .string { color: blue; }
    .number { color: darkorange; }
    .boolean { color: green; }
    .null { color: magenta; }
    .key { color: red; }
</style>
</head>
<body>

<div class="documentContent"  id="documentContent">
	<div class="top-div"><em></em><span>&nbsp;>&nbsp;系统监控&nbsp;>&nbsp;系统配置信息</span></div>
	<pre id="result"></pre>
</div>

<script type="text/javascript">
$(document).ready(function(){
	
	getPageData();

	blindPageElement();
	
});

function blindPageElement(){
	
	var bodyHt=document.documentElement.clientHeight;
	var tableDivHeight = bodyHt-77;	
	$('#result').height(tableDivHeight);
	
	$(".form-title").click(function(){
        var b = $(this).parent(".form-box").children(".form-content");
        if(b.css("display") == "block"){
			b.slideUp();
            $(this).children("em").removeClass("show");
            $(this).children("em").addClass("hide");
        }else{
            $(this).children("em").removeClass("hide");
            $(this).children("em").addClass("show");
			b.slideDown();
        }
    });
	
}

function getPageData(){
 	var url = '<%=basePath%>/webframework/monitor/systemMonitor/getConfigViewData.do';
	$.ajax({  
        url:url,  
        type:'post',  
        dataType:'json',  
        success:function(data,textStatus,jqXHR){  
        	$('#result').html(syntaxHighlight(data));
        },  
        error:function(XMLHttpRequest,textStatus,errorThrown){  
        }                     
    });
	
}



function syntaxHighlight(json) {
    if (typeof json != 'string') {
        json = JSON.stringify(json, undefined, 2);
    }
    json = json.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
    return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function(match) {
        var cls = 'number';
        if (/^"/.test(match)) {
            if (/:$/.test(match)) {
                cls = 'key';
            } else {
                cls = 'string';
            }
        } else if (/true|false/.test(match)) {
            cls = 'boolean';
        } else if (/null/.test(match)) {
            cls = 'null';
        }
        return '<span class="' + cls + '">' + match + '</span>';
    });
}





</script>
</body>
</html>